<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: DataDownloader</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">DataDownloader</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/lib/data_downloader_rb.html">
                lib/data_downloader.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
This class is used to download data files from the MLB <a
href="Gameday.html">Gameday</a> site to local storage. The data that is
downloaded will be stored into a path that replicates the MLB <a
href="Gameday.html">Gameday</a> paths, for example here is a sample path
for a specified date:
</p>
<pre>
  /components/game/mlb/year_2008/month_04/day_07
</pre>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000108">download_all_for_date</a>&nbsp;&nbsp;
      <a href="#M000099">download_all_for_game</a>&nbsp;&nbsp;
      <a href="#M000109">download_all_for_month</a>&nbsp;&nbsp;
      <a href="#M000100">download_batters_for_game</a>&nbsp;&nbsp;
      <a href="#M000102">download_inning_for_game</a>&nbsp;&nbsp;
      <a href="#M000103">download_media_for_game</a>&nbsp;&nbsp;
      <a href="#M000104">download_notification_for_game</a>&nbsp;&nbsp;
      <a href="#M000105">download_onbase_for_game</a>&nbsp;&nbsp;
      <a href="#M000101">download_pitchers_for_game</a>&nbsp;&nbsp;
      <a href="#M000107">download_xml_for_date</a>&nbsp;&nbsp;
      <a href="#M000106">download_xml_for_game</a>&nbsp;&nbsp;
      <a href="#M000111">tmp_fetch_pages_for_game</a>&nbsp;&nbsp;
      <a href="#M000110">tmp_fetch_pages_for_month</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">


    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">FILE_BASE_PATH</td>
          <td>=</td>
          <td class="context-item-value">'components/game'</td>
        </tr>
        </table>
      </div>
    </div>



      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000108" class="method-detail">
        <a name="M000108"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000108.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000108.html');return false;">
          <span class="method-name">download_all_for_date</span><span class="method-args">(year, month, day)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000099" class="method-detail">
        <a name="M000099"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000099.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000099.html');return false;">
          <span class="method-name">download_all_for_game</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Downloads all data files associated with the game specified by the game id
passed in.
</p>
        </div>
      </div>

      <div id="method-M000109" class="method-detail">
        <a name="M000109"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000109.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000109.html');return false;">
          <span class="method-name">download_all_for_month</span><span class="method-args">(year, month)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000100" class="method-detail">
        <a name="M000100"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000100.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000100.html');return false;">
          <span class="method-name">download_batters_for_game</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000102" class="method-detail">
        <a name="M000102"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000102.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000102.html');return false;">
          <span class="method-name">download_inning_for_game</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000103" class="method-detail">
        <a name="M000103"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000103.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000103.html');return false;">
          <span class="method-name">download_media_for_game</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000104" class="method-detail">
        <a name="M000104"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000104.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000104.html');return false;">
          <span class="method-name">download_notification_for_game</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000105" class="method-detail">
        <a name="M000105"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000105.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000105.html');return false;">
          <span class="method-name">download_onbase_for_game</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000101" class="method-detail">
        <a name="M000101"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000101.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000101.html');return false;">
          <span class="method-name">download_pitchers_for_game</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000107" class="method-detail">
        <a name="M000107"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000107.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000107.html');return false;">
          <span class="method-name">download_xml_for_date</span><span class="method-args">(year, month, day)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000106" class="method-detail">
        <a name="M000106"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000106.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000106.html');return false;">
          <span class="method-name">download_xml_for_game</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Downloads the top-level xml directories for the game specified by the
passed in game id. The files include:
</p>
<pre>
   bench.xml
   benchO.xml
   boxscore.xml
   emailSource.xml
   eventLog.xml
   game.xml
   game_events.xml
   gamecenter.xml
   gameday_Syn.xml
   linescore.xml
   miniscoreboard.xml
   players.xml
   plays.xml
</pre>
        </div>
      </div>

      <div id="method-M000111" class="method-detail">
        <a name="M000111"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000111.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000111.html');return false;">
          <span class="method-name">tmp_fetch_pages_for_game</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000110" class="method-detail">
        <a name="M000110"></a>

        <div class="method-heading">
          <a href="DataDownloader.src/M000110.html" target="Code" class="method-signature"
            onclick="popupCode('DataDownloader.src/M000110.html');return false;">
          <span class="method-name">tmp_fetch_pages_for_month</span><span class="method-args">(year, month, end_day)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>